<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK" %>
<%@ taglib uri="/WEB-INF/page.tld" prefix="page" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href='<s:url value="/css/common.css"/>' rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
<script type="text/javascript">
	function FCKeditor_OnComplete(editorInstance) {
		window.status = editorInstance.Description;
	}
</script>
<title><s:property value="article.title"/></title>
</head>
<body>
<table style="width: 1024px;" align="center"><tr><td>
<s:include value="/common/header.jsp" />
<div style="width: 100%;background: #99ffcc;">
	<s:url value="/category" id="index" includeParams="none"/>
	<s:a href="%{index}">首页</s:a>
	<s:a href="%{index}/%{articleCategory.id}">
		⇒<s:property value="articleCategory.categoryName" />帖子列表
	</s:a>
	⇒<s:property value="title" />
</div>
<table style="border: 1px;border-style: solid;width: 100%;">
	<tr>
		<td colspan="2" class="articleTitle">
			<div style="float: left;">
				<s:property value="title"/>
			</div>
			<div style="float: right;">
				<s:url value="/article" id="gotoEdit" includeParams="none"/>
				<s:if test="#session.loginInfo.id == userId">
					<s:a href="%{gotoEdit}/%{id}/edit">编辑</s:a>
				</s:if>
			</div>
		</td>
	</tr>
	<tr>
	  <td style="width: 150px;height: 200px;" class="articleContent">
	  	<s:property value="userName"/>&nbsp;
	  </td>
	  <td class="articleContent">
	  	<div style="overflow: auto;width: 874px;">
	  		<s:property value="content" escape="false"/>
	  	</div>
	  	<div style="overflow: auto;width: 874px;">
	  		<s:iterator value="attachmentsList">
	  			<s:property value="fileName"/><br>
	  			<s:property value="hasSaveToDB"/><br>
	  			<img height="400" width="600" 
	  				alt="<s:property value='fileName'/>" 
	  				src='<s:url value="/article/%{id}/dynamicImage"/>'/>
	  		</s:iterator>
	  	</div>
	  </td>
	</tr>
	<s:iterator value="subArticleList">
		<tr>
			<td colspan="2" class="articleTitle">
				<div style="float: left;">
					<s:property value="title"/>
				</div>
				<div style="float: right;display: none;">
					<s:url value="/bbs/gotoEditSubArticle.action" id="gotoEditSub" includeParams="none"/>
					<s:if test="#session.loginInfo.id == userId">
						<s:a href="%{gotoEditSub}?subArticle.id=%{id}">编辑</s:a>
					</s:if>
				</div>
			</td>
		</tr>
		<tr>
		  <td style="width: 150px;height: 200px;" class="articleContent">
		  	<s:property value="userName"/>&nbsp;
		  </td>
		  <td class="articleContent">
		  	<div style="overflow: auto;width: 874px;">
		  		<s:property value="content" escape="false"/>
		  	</div>
		  </td>
		</tr>
	</s:iterator>
</table>
<page:pager requestPath="/article/${id}"/>
<br>
<div>快速回复</div>
<table>
	<tr>
		<td style="width: 300px;">
			其他信息
		</td>
		<td>
			<s:form action="/article/%{id}/createSubArticle" namespace="/">
				<s:actionmessage /> 
				<s:textfield key="subArticleTitle" label="标题" />
				<s:hidden key="articleId" value="%{id}"/>
				<table>
					<tr><td>
						<FCK:editor instanceName="subArticleContent" height="400" width="800">
							<jsp:attribute name="value">
								<s:property value="%{#request.subArticleContent}" escape="false"/>
							</jsp:attribute>
						</FCK:editor>
					</td></tr>
				</table>
				<s:submit />
			</s:form>
		</td>
	</tr>
</table>
<s:include value="/common/footer.jsp" />
</td></tr></table>
</body>
</html>